package com.gitee.dao;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface UserDao {
    //用户充值
    @Update("update user set moneyRS=moneyRS - #{recharge} where userid = #{userid}")
    public int insert(String userid,double recharge);
    //根据用户id查询用户账户余额
    @Select("select moneyRS from user where userid= #{userid}")
    public double selectRS(String userid);
    //根据用户id修改用户账户余额
    @Update("update user set moneyRS=moneyRS - #{expense} where userid = #{userid}")
    public int update(String userid,double expense);
}
